New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use getTimeFormat for encounter date of service datetime picker #7203
base: master
Are you sure you want to change the base?
Conversation
hi @stephenwaite , fun stuff :)
|
testing well, thanks for the review, not sure about your hint but it made me take a deep 🤿 |
interface/forms/note/new.php
Outdated
value='<?php echo attr(date('Y-m-d', time())); ?>' | ||
title='<?php echo xla('yyyy-mm-dd'); ?>' /> | ||
<input class="datepicker form-control" type='text' size='16' class='datepicker' name='date_of_signature' id='date_of_signature' | ||
value='<?php echo attr(oeFormatDateTime(date('Y-m-d H:i', time()), $GLOBALS['time_display_format'])); ?>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note if follow oeFormatDateTime to oeFormatTime, no need to set the 2nd parameter (if defaults to 'global' which then uses $GLOBALS['time_display_format'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that when formatInput is used the entry needs to be standardized at some point before going into the daatabase (via the DateTimeToYYYYMMDDHHMMSS() function ).
This form also has a discrepancy in it's view.php for this date widget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So 2 things happen for internat to work on the datetimes.
- A standard datetime is converted to the localize format via oeFormatDateTime in the datepicker
- When saved or used in scripts it is converted back to the standard datetime via the DateTimeToYYYYMMDDHHMMSS function
(rec checking out DateTimeToYYYYMMDDHHMMSS use in code to get an idea how it works)
interface/reports/amc_tracking.php
Outdated
@@ -202,7 +202,7 @@ function provide_sum_pat(patient_id,encounter_id) { | |||
<?php echo xlt('Begin Date'); ?>: | |||
</td> | |||
<td> | |||
<input type='text' name='form_begin_date' id="form_begin_date" size='20' value='<?php echo attr(oeFormatDateTime($begin_date, 0, true)); ?>' class='datepicker form-control' /> | |||
<input type='text' name='form_begin_date' id="form_begin_date" size='20' value='<?php echo attr(oeFormatDateTime($begin_date, $GLOBALS['time_display_format'], true)); ?>' class='datepicker form-control' /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in cases where you need to use the 2nd parameter (since need to set the second parameter to true, would just use the '"global" string instead of the actual global)
@@ -41,6 +41,8 @@ | |||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will need to ensure the new library/js/xl/jquery-datetimepicker-2-5-4-translated.js has same logic for the fixed time stuff
@stephenwaite I realize the other PR I brought in is now creating issues. Do you want this in 7.0.2.1 patch? Or do we bump to 7.0.2.2? I won't be able to revisit this until Wednesday if you need me to pull down and review. |
Hi @adunsulag. I think @bradymiller addressed that for me so I'll take another crack at this with the hopes of getting it in patch 1. |
Fixes #7202
Short description of what this resolves:
Changes proposed in this pull request: